<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Javascript 类 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档</title>
  

  
  
  <link rel="shortcut icon" href="../_static/ci-icon.ico" />
  

  
  <link href="../_static/css/fonts.css" rel="stylesheet" type="text/css" />

  
  
    

  

  
  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  

  
  <link rel="stylesheet" href="../_static/css/theme_cn.css" type="text/css" />
    <link rel="top" title="CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" href="../index.html"/>
        <link rel="up" title="类库参考" href="index.html"/>
        <link rel="next" title="语言类" href="language.html"/>
        <link rel="prev" title="输入类" href="input.html"/> 

  
  <script src="../_static/js/modernizr.2.6.2.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div id="nav">
  <div id="nav_inner">
    
    
    
      <div id="pulldown-menu" class="ciNav">
        <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">类库参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="input.html">输入类</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">数据库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">数据库工具类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">辅助函数参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

      </div>
    
      
  </div>
</div>
<div id="nav2">
  <a href="#" id="openToc">
    <img src="" title="切换目录" alt="切换目录" />
  </a>
</div>

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-nav-search">
        
          <a href="../index.html" class="fa fa-home"> CodeIgniter</a>
        
        
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="搜索手册" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
        
          
          
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">类库参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="input.html">输入类</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">数据库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">数据库工具类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">辅助函数参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

          
        
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../index.html">CodeIgniter</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../index.html">首页</a> &raquo; </li>
    
    <li><a href="index.html">类库参考</a> &raquo; </li>
    
    <li>Javascript 类</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
    <div style="float:right;">
      <div style="text-decoration:underline;color:blue;margin-left:5px;cursor:pointer;" id="closeMe">
        <img title="目录" alt="toc" src="" />
      </div>
    </div>
  </ul>
  <hr/>
</div>
          <div role="main" class="document">
            
  <div class="section" id="javascript">
<h1>Javascript 类<a class="headerlink" href="#javascript" title="永久链接至标题">¶</a></h1>
<p>CodeIgniter 提供一个类库和一些共用的方法来处理 Javascript 。要注意的是，
CodeIgniter 并不是只能用于 jQuery ，其他脚本库也可以。JQuery 仅仅是
作为一个方便的工具，如果你选择使用它的话。</p>
<div class="admonition important">
<p class="first admonition-title">重要</p>
<p class="last">这个类库已经废弃，不要使用它。它将永远处于 &quot;实验&quot; 版本，
而且现在也已经不提供支持了。保留它只是为了向前兼容。</p>
</div>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#id1" id="id11">使用 Javascript 类</a><ul>
<li><a class="reference internal" href="#id2" id="id12">初始化类</a></li>
<li><a class="reference internal" href="#id3" id="id13">初始化配置</a><ul>
<li><a class="reference internal" href="#id4" id="id14">在视图文件中设置变量</a></li>
<li><a class="reference internal" href="#id5" id="id15">设置库路径</a></li>
</ul>
</li>
<li><a class="reference internal" href="#jquery" id="id16">jQuery 类</a></li>
<li><a class="reference internal" href="#id6" id="id17">jQuery 事件</a></li>
<li><a class="reference internal" href="#id8" id="id18">特效</a><ul>
<li><a class="reference internal" href="#hide-show" id="id19">hide() / show()</a></li>
<li><a class="reference internal" href="#toggle" id="id20">toggle()</a></li>
<li><a class="reference internal" href="#animate" id="id21">animate()</a></li>
<li><a class="reference internal" href="#toggleclass" id="id22">toggleClass()</a></li>
<li><a class="reference internal" href="#fadein-fadeout" id="id23">fadeIn() / fadeOut()</a></li>
<li><a class="reference internal" href="#slideup-slidedown-slidetoggle" id="id24">slideUp() / slideDown() / slideToggle()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id10" id="id25">插件</a><ul>
<li><a class="reference internal" href="#corner" id="id26">corner()</a></li>
<li><a class="reference internal" href="#tablesorter" id="id27">tablesorter()</a></li>
<li><a class="reference internal" href="#modal" id="id28">modal()</a></li>
<li><a class="reference internal" href="#calendar" id="id29">calendar()</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="custom-index container"></div><div class="section" id="id1">
<h2><a class="toc-backref" href="#id11">使用 Javascript 类</a><a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
<div class="section" id="id2">
<h3><a class="toc-backref" href="#id12">初始化类</a><a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
<p>要初始化 Javascript 类，你可以在控制器的构造函数中使用 <tt class="docutils literal"><span class="pre">$this-&gt;load-&gt;library()</span></tt>
函数。目前，唯一可用的库是 jQuery ，可以使用下面的方法加载:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">library</span><span class="p">(</span><span class="s1">&#39;javascript&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p>Javascript 类也可以接受参数：</p>
<ul class="simple">
<li>js_library_driver (string) <em>default: 'jquery'</em></li>
<li>autoload (bool) <em>default: TRUE</em></li>
</ul>
<p>你可以通过一个关联数组覆盖默认的参数:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">library</span><span class="p">(</span>
    <span class="s1">&#39;javascript&#39;</span><span class="p">,</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;js_library_driver&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;scripto&#39;</span><span class="p">,</span>
        <span class="s1">&#39;autoload&#39;</span> <span class="o">=&gt;</span> <span class="k">FALSE</span>
    <span class="p">)</span>
<span class="p">);</span>
</pre></div>
</div>
<p>再次说明，目前只有 jQuery 是可用的，如果你不想让 jQuery 脚本文件自动的包含在
script 标签中，你可以设置 autoload 参数为 FALSE 。这在当你在 CodeIgniter 之外
加载它时，或者 script 标签已经有了的时候很有用。</p>
<p>一旦加载完成，jQuery 类对象就可以通过下面的方式使用:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">javascript</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h3><a class="toc-backref" href="#id13">初始化配置</a><a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
<div class="section" id="id4">
<h4><a class="toc-backref" href="#id14">在视图文件中设置变量</a><a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h4>
<p>作为一个 Javascript 库，源文件必须能被应用程序访问到。</p>
<p>由于 Javascript 是一种客户端语言，库必须能写入内容到最终的输出中去，
这通常就是视图。你需要在输出的 <tt class="docutils literal"><span class="pre">&lt;head&gt;</span></tt> 中包含下面的变量。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="o">&lt;?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nv">$library_src</span><span class="p">;</span><span class="cp">?&gt;</span>
<span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$script_head</span><span class="p">;</span><span class="cp">?&gt;</span>
</pre></div>
</div>
<p><tt class="docutils literal"><span class="pre">$library_src</span></tt> 是要载入的库文件的路径，以及之后所有插件脚本的路径；
<tt class="docutils literal"><span class="pre">$script_head</span></tt> 是需要显示的具体的一些事件、函数和其他的命令。</p>
</div>
<div class="section" id="id5">
<h4><a class="toc-backref" href="#id15">设置库路径</a><a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h4>
<p>在 Javascript 类库中有一些配置项，它们可以在 <em>application/config.php</em> 文件中
设置，也可以在它们自己的配置文件 <em>config/javascript.php</em> 中设置，还可以通过
在控制器中使用 <tt class="docutils literal"><span class="pre">set_item()</span></tt> 方法来设置。</p>
<p>例如，有一个 &quot;加载中&quot; 的图片，或者进度条指示，如果没有它的话，当调用 Ajax 请求时，
将会显示 &quot;加载中&quot; 这样的文本。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;javascript_location&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;http://localhost/codeigniter/themes/js/jquery/&#39;</span><span class="p">;</span>
<span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;javascript_ajax_img&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;images/ajax-loader.gif&#39;</span><span class="p">;</span>
</pre></div>
</div>
<p>如果你把文件留在与图片下载路径相同的目录里，那么你不需要设置这个配置项。</p>
</div>
</div>
<div class="section" id="jquery">
<h3><a class="toc-backref" href="#id16">jQuery 类</a><a class="headerlink" href="#jquery" title="永久链接至标题">¶</a></h3>
<p>要在你的控制器构造函数中手工初始化 jQuery 类，使用 <tt class="docutils literal"><span class="pre">$this-&gt;load-&gt;library()</span></tt> 方法:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">library</span><span class="p">(</span><span class="s1">&#39;javascript/jquery&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p>你可以提供一个可选的参数来决定加载该库时是否将其自动包含到 script 标签中。
默认情况下会包含，如果不需要，可以像下面这样来加载:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">library</span><span class="p">(</span><span class="s1">&#39;javascript/jquery&#39;</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">);</span>
</pre></div>
</div>
<p>加载完成后，jQuery 类对象可以使用下面的代码来访问:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span>
</pre></div>
</div>
</div>
<div class="section" id="id6">
<h3><a class="toc-backref" href="#id17">jQuery 事件</a><a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h3>
<p>使用下面的语法来设置事件。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">event</span><span class="p">(</span><span class="s1">&#39;element_path&#39;</span><span class="p">,</span> <span class="nx">code_to_run</span><span class="p">());</span>
</pre></div>
</div>
<p>在上面的例子中：</p>
<ul class="simple">
<li>&quot;event&quot; 可以是 blur、change、click、dblclick、error、focus、hover、
keydown、keyup、load、mousedown、mouseup、mouseover、mouseup、resize、
scroll 或者 unload 中的任何一个事件。</li>
<li>&quot;element_path&quot; 可以是任何的 <a class="reference external" href="http://api.jquery.com/category/selectors/">jQuery 选择器</a> 。
使用 jQuery 独特的选择器语法，通常是一个元素 ID 或 CSS 选择器。例如，&quot;#notice_area&quot;
会影响到 <tt class="docutils literal"><span class="pre">&lt;div</span> <span class="pre">id=&quot;notice_area&quot;&gt;</span></tt> ，&quot;#content a.notice&quot; 会影响到 ID 为 &quot;content&quot;
的元素下的所有 class 为 &quot;notice&quot; 的链接。</li>
<li>&quot;<tt class="docutils literal"><span class="pre">code_to_run()</span></tt>&quot; 为你自己写的脚本，或者是一个 jQuery 动作，例如下面所介绍的特效。</li>
</ul>
</div>
<div class="section" id="id8">
<h3><a class="toc-backref" href="#id18">特效</a><a class="headerlink" href="#id8" title="永久链接至标题">¶</a></h3>
<p>jQuery 库支持很多强大的 <a class="reference external" href="http://api.jquery.com/category/effects/">特效</a> ，在使用特效之前，
必须使用下面的方法加载:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">effect</span><span class="p">([</span><span class="nx">optional</span> <span class="nx">path</span><span class="p">]</span> <span class="nx">plugin</span> <span class="nx">name</span><span class="p">);</span> <span class="c1">// for example $this-&gt;jquery-&gt;effect(&#39;bounce&#39;);</span>
</pre></div>
</div>
<div class="section" id="hide-show">
<h4><a class="toc-backref" href="#id19">hide() / show()</a><a class="headerlink" href="#hide-show" title="永久链接至标题">¶</a></h4>
<p>这两个函数会影响你的页面上元素的可见性，hide() 函数用于将元素隐藏，show() 则相反。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">hide</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">show</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;speed&quot; 可选，可以设置为 slow、normal、fast 或你自己设置的毫秒数。</li>
<li>&quot;extra information&quot; 可选，可以包含一个回调，或者其他的附加信息。</li>
</ul>
</div>
<div class="section" id="toggle">
<h4><a class="toc-backref" href="#id20">toggle()</a><a class="headerlink" href="#toggle" title="永久链接至标题">¶</a></h4>
<p>toggle() 用于将元素的可见性改成和当前的相反，将可见的元素隐藏，将隐藏的元素可见。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">toggle</span><span class="p">(</span><span class="nx">target</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
</ul>
</div>
<div class="section" id="animate">
<h4><a class="toc-backref" href="#id21">animate()</a><a class="headerlink" href="#animate" title="永久链接至标题">¶</a></h4>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">animate</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">parameters</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;parameters&quot; 通常是你想改变元素的一些 CSS 属性。</li>
<li>&quot;speed&quot; 可选，可以设置为 slow、normal、fast 或你自己设置的毫秒数。</li>
<li>&quot;extra information&quot; 可选，可以包含一个回调，或者其他的附加信息。</li>
</ul>
<p>更完整的说明，参见 <a class="reference external" href="http://api.jquery.com/animate/">http://api.jquery.com/animate/</a></p>
<p>下面是个在 ID 为 &quot;note&quot; 的一个 div 上使用 animate() 的例子，它使用了 jQuery 库的 click 事件，
通过 click 事件触发。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$params</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
<span class="s1">&#39;height&#39;</span> <span class="o">=&gt;</span> <span class="mi">80</span><span class="p">,</span>
<span class="s1">&#39;width&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;50%&#39;</span><span class="p">,</span>
<span class="s1">&#39;marginLeft&#39;</span> <span class="o">=&gt;</span> <span class="mi">125</span>
<span class="p">);</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">click</span><span class="p">(</span><span class="s1">&#39;#trigger&#39;</span><span class="p">,</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">animate</span><span class="p">(</span><span class="s1">&#39;#note&#39;</span><span class="p">,</span> <span class="nv">$params</span><span class="p">,</span> <span class="s1">&#39;normal&#39;</span><span class="p">));</span>
</pre></div>
</div>
</div>
<div class="section" id="toggleclass">
<h4><a class="toc-backref" href="#id22">toggleClass()</a><a class="headerlink" href="#toggleclass" title="永久链接至标题">¶</a></h4>
<p>该函数用于往目标元素添加或移除一个 CSS 类。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">toggleClass</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">class</span><span class="p">)</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;class&quot; 是任何 CSS 类名，注意这个类必须是在某个已加载的 CSS 文件中定义的。</li>
</ul>
</div>
<div class="section" id="fadein-fadeout">
<h4><a class="toc-backref" href="#id23">fadeIn() / fadeOut()</a><a class="headerlink" href="#fadein-fadeout" title="永久链接至标题">¶</a></h4>
<p>这两个特效会使某个元素渐变的隐藏和显示。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">fadeIn</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span>  <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">fadeOut</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span>  <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;speed&quot; 可选，可以设置为 slow、normal、fast 或你自己设置的毫秒数。</li>
<li>&quot;extra information&quot; 可选，可以包含一个回调，或者其他的附加信息。</li>
</ul>
</div>
<div class="section" id="slideup-slidedown-slidetoggle">
<h4><a class="toc-backref" href="#id24">slideUp() / slideDown() / slideToggle()</a><a class="headerlink" href="#slideup-slidedown-slidetoggle" title="永久链接至标题">¶</a></h4>
<p>这些特效可以让元素滑动。</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">slideUp</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span>  <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">slideDown</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span>  <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">slideToggle</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span>  <span class="nx">optional</span> <span class="nx">speed</span><span class="p">,</span> <span class="nx">optional</span> <span class="nx">extra</span> <span class="nx">information</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;speed&quot; 可选，可以设置为 slow、normal、fast 或你自己设置的毫秒数。</li>
<li>&quot;extra information&quot; 可选，可以设置为 slow、normal、fast 或你自己设置的毫秒数。</li>
</ul>
</div>
</div>
<div class="section" id="id10">
<h3><a class="toc-backref" href="#id25">插件</a><a class="headerlink" href="#id10" title="永久链接至标题">¶</a></h3>
<p>使用这个库时还有几个 jQuery 插件可用。</p>
<div class="section" id="corner">
<h4><a class="toc-backref" href="#id26">corner()</a><a class="headerlink" href="#corner" title="永久链接至标题">¶</a></h4>
<p>用于在页面的某个元素四周添加不同样式的边角。更多详细信息，参考
<a class="reference external" href="http://malsup.com/jquery/corner/">http://malsup.com/jquery/corner/</a></p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">corner</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">corner_style</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li>&quot;target&quot; 是任何有效的 jQuery 选择器。</li>
<li>&quot;corner_style&quot; 可选，可以设置为任何有效的样式，例如：
round、sharp、bevel、bite、dog 等。如果只想设置某个边角的样式，
可以在样式后添加一个空格，然后使用 &quot;tl&quot; （左上），&quot;tr&quot; （右上），
&quot;bl&quot; （左下），和 &quot;br&quot; （右下）。</li>
</ul>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">jquery</span><span class="o">-&gt;</span><span class="na">corner</span><span class="p">(</span><span class="s2">&quot;#note&quot;</span><span class="p">,</span> <span class="s2">&quot;cool tl br&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="tablesorter">
<h4><a class="toc-backref" href="#id27">tablesorter()</a><a class="headerlink" href="#tablesorter" title="永久链接至标题">¶</a></h4>
<p>待添加</p>
</div>
<div class="section" id="modal">
<h4><a class="toc-backref" href="#id28">modal()</a><a class="headerlink" href="#modal" title="永久链接至标题">¶</a></h4>
<p>待添加</p>
</div>
<div class="section" id="calendar">
<h4><a class="toc-backref" href="#id29">calendar()</a><a class="headerlink" href="#calendar" title="永久链接至标题">¶</a></h4>
<p>待添加</p>
</div>
</div>
</div>
</div>


          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="language.html" class="btn btn-neutral float-right" title="语言类">下一个主题 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="input.html" class="btn btn-neutral" title="输入类"><span class="fa fa-arrow-circle-left"></span> 上一个主题</a>
      
    </div>
  

  
  <div id="notes">
  
  <!-- 多说评论框 start -->
    <div class="ds-thread" data-thread-key="userguide3/libraries/javascript" data-title="Javascript 类" data-url="http://codeigniter.org.cn/user_guide/libraries/javascript.html"></div>
  <!-- 多说评论框 end -->
  

  <div class="ds-share flat" data-thread-key="userguide3/libraries/javascript" data-title="Javascript 类 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" data-url="http://codeigniter.org.cn/user_guide/libraries/javascript.html" data-images="" data-content="">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">

        <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
  </div>

  <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
  <script type="text/javascript">
    var duoshuoQuery = {short_name:"codeigniter"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0]
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
  <!-- 多说公共JS代码 end -->
  </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; 版权所有 2014 - 2015, 不列颠哥伦比亚理工学院.
       最后修改: 2015-10-11.
    </p>

    <p>以 <a href="http://www.aneasystone.com/" target="_blank">aneasystone</a> 制作的手册为基础构建</p>
  </div>

  
    <p>基于 <a href="http://sphinx-doc.org/">Sphinx</a> 并使用 <a href="https://readthedocs.org">Read the Docs</a> 提供的<a href="https://github.com/snide/sphinx_rtd_theme">风格</a>构建</p>
    <p>
        <a href="https://github.com/CodeIgniter-Chinese/codeigniter-user-guide" target="_blank">Github 简体中文翻译</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/codeigniter_user_guide.zip">离线版压缩包下载</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/CodeIgniter.pdf">PDF 版下载</a>
    </p>
  

</footer>
        </div>
      </div>

    </section>

  </div>
  

  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../',
            VERSION:'3.0.2',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  false
        };
    </script>
      <script type="text/javascript" src="../_static/jquery.js"></script>
      <script type="text/javascript" src="../_static/underscore.js"></script>
      <script type="text/javascript" src="../_static/doctools.js"></script>
      <script type="text/javascript" src="../_static/translations.js"></script>

  

  
  
    <script type="text/javascript" src="../_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

  
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-272152-3', 'auto');
        ga('send', 'pageview');
    </script>
  

</body>
</html>